<template>
    <div>
        <h1>红红火火恍恍惚惚</h1>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td align="right">姓名</td>
                    <td><input type="text" v-model="list.muname"></td>
                </tr>
                <tr>
                    <td align="right">门店名称</td>
                    <td><input type="text" v-model="list.msname"></td>
                </tr>
                <tr>
                    <td align="right">门店应收款</td>
                    <td><input type="text" v-model="list.mzmoney"></td>
                </tr>
                <tr>
                    <td align="right">门店实际收款</td>
                    <td><input type="text" v-model="list.msmoney"></td>
                </tr>
                <tr>
                    <td align="right">门店状态</td>
                    <td>
                        <input type="radio" v-model="list.mzt" :value="1" name="mzt">营业
                        <input type="radio" v-model="list.mzt" :value="0" name="mzt">闭店
                    </td>
                </tr>
                <tr>
                    <td align="right">现金收银信息</td>
                    <td><input type="text" v-model="list.mxmoney"></td>
                </tr>
                <tr>
                    <td align="right"></td>
                    <td><input type="button" value="添加" @click="add" class="btn btn-primary"></td>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script setup lang="ts">
import 'bootstrap/dist/css/bootstrap.css'
import axios from 'axios'
import { ref, reactive } from 'vue';
import { useRoute,useRouter } from 'vue-router';
import router from '@/router';
let list: any = reactive({
    "muname": "",
    "msname": "",
    "mzmoney": '',
    "msmoney": '',
    "mzt": 1,
    "mxmoney": ''
})

const add = () => {
    axios({
        url: '/api/Mess/AddM',
        method: 'post',
        data: list
    })
        .then(res => {
            if (res.data > 0) {
                alert('添加成功！');
                router.push('/mshow');
            }
            else {
                alert('添加失败！');
                return;
            }
        })
        .catch(err => {
            console.log(err);
        })
}

</script>

<style scoped></style>